[SPARK-25408] Move to more ideomatic Java8#22637
Conversation
|
ok to test |
1 similar comment
|
ok to test |
|
mind filling PR description please? |
There was a problem hiding this comment.
Nit: move this onto the previous line
There was a problem hiding this comment.
I wouldn't bother with this. This is a copy of some Hive code anyway
|
Jenkins test this please |
|
Test build #96969 has finished for PR 22637 at commit
|
|
Test build #96970 has finished for PR 22637 at commit
|
|
Valid points. Personally I'm a fan of explicit final, instead of implicit. But that's a matter of taste :-) |
|
Test build #96972 has finished for PR 22637 at commit
|
|
Test build #96974 has finished for PR 22637 at commit
|
|
Test build #96967 has finished for PR 22637 at commit
|
|
Test build #96975 has finished for PR 22637 at commit
|
|
retest this please |
|
Test build #96979 has finished for PR 22637 at commit
|
There was a problem hiding this comment.
Indentation? It seems to follow 4-space indentation for Java style, but it seems to be too outstanding in this file. For the rest of the patch, could you adjust a little bit more to be consistent in a single file?
|
While we're at it, it would be great to fix the typo in the PR title. |
|
Thanks @dongjoon-hyun. I've fixed the indentation issues. |
|
Test build #97031 has finished for PR 22637 at commit
|
There was a problem hiding this comment.
There's a compile error here. But note you can have multiple Closeables declared in one try block anyway, so these can be merged.
There was a problem hiding this comment.
It's hard to know the best way to wrap these things, but here you have the continuation line indented less than the one that starts the statement. I think we can't do that. I'd indent both continuations 2 spaces from their preceding line ideally. Here and elsewhere where the try statement has to wrap.
|
Test build #97063 has finished for PR 22637 at commit
|
Use features from Java8 such as: - Try-with-resource blocks
|
Test build #97072 has finished for PR 22637 at commit
|
|
OK, trying this again. Tests have definitely run this time and we've had another good pass at small review changes. |
While working on another PR, I noticed that there is quite some legacy Java in there that can be beautified. For example the use of features from Java8, such as: - Collection libraries - Try-with-resource blocks No logic has been changed. I think it is important to have a solid codebase with examples that will inspire next PR's to follow up on the best practices. What are your thoughts on this? This makes code easier to read, and using try-with-resource makes is less likely to forget to close something. ## What changes were proposed in this pull request? No changes in the logic of Spark, but more in the aesthetics of the code. ## How was this patch tested? Using the existing unit tests. Since no logic is changed, the existing unit tests should pass. Please review http://spark.apache.org/contributing.html before opening a pull request. Closes apache#22637 from Fokko/SPARK-25408. Authored-by: Fokko Driesprong <fokkodriesprong@godatadriven.com> Signed-off-by: Sean Owen <sean.owen@databricks.com>
While working on another PR, I noticed that there is quite some legacy Java in there that can be beautified. For example the use of features from Java8, such as:
No logic has been changed. I think it is important to have a solid codebase with examples that will inspire next PR's to follow up on the best practices.
What are your thoughts on this?
This makes code easier to read, and using try-with-resource makes is less likely to forget to close something.
What changes were proposed in this pull request?
No changes in the logic of Spark, but more in the aesthetics of the code.
How was this patch tested?
Using the existing unit tests. Since no logic is changed, the existing unit tests should pass.
Please review http://spark.apache.org/contributing.html before opening a pull request.